Skip to content

runtime: attribute panic caller lines#1925

Draft
cpunion wants to merge 5 commits into
xgo-dev:mainfrom
cpunion:codex/goroot-fixedbugs-panic-lines
Draft

runtime: attribute panic caller lines#1925
cpunion wants to merge 5 commits into
xgo-dev:mainfrom
cpunion:codex/goroot-fixedbugs-panic-lines

Conversation

@cpunion
Copy link
Copy Markdown
Collaborator

@cpunion cpunion commented May 24, 2026

Summary

  • build on the caller-frame metadata path from runtime: track caller frames for LLGo metadata #1884 and update caller line attribution immediately before panic-prone SSA operations
  • preserve the caller-frame snapshot captured at panic time so deferred runtime.Caller(2) can report the panic site
  • add LLGo-run test/go coverage for explicit panic, nil field panic, bounds panic CallersFrames, and deferred return caller lines
  • remove verified darwin/arm64 xfails for bug347.go, bug348.go, issue14646.go, issue29504.go, issue4562.go, and issue5856.go

Scope

  • Left issue27201.go xfailed: it depends on runtime.Stack line output, which is covered by the separate lineinfo/runtime.Stack work.
  • Left issue33724.go xfailed: it currently fails because the promoted-method nil access does not panic, which is nil/method semantics rather than caller-line attribution.
  • This branch is stacked on the already-open caller-frame metadata PR runtime: track caller frames for LLGo metadata #1884; the final commit is the panic-line attribution delta.

Tests

  • go test ./test/go -run TestRuntimePanicCallerLineAttribution -count=1 -timeout=10m
  • go test ./test/go -run 'TestRuntime(Caller|Callers|PanicCaller)' -count=1 -timeout=10m
  • go test ./test/goroot -run TestGoRootRunCases -count=1 -timeout=15m -args -goroot /opt/homebrew/Cellar/go@1.24/1.24.11/libexec -dirs fixedbugs -case '^(fixedbugs/(bug347|bug348|issue14646|issue29504|issue4562|issue5856)\\.go)$' -xfail /dev/null -run-timeout 2m -build-timeout 5m
  • go test ./test/goroot -run TestGoRootRunCases -count=1 -timeout=15m -args -goroot /opt/homebrew/Cellar/go@1.24/1.24.11/libexec -dirs fixedbugs -case '^(fixedbugs/(bug347|bug348|issue14646|issue29504|issue4562|issue5856)\\.go)$' -run-timeout 2m -build-timeout 5m
  • go test ./test/goroot -run TestGoRootRunCases -count=1 -timeout=15m -args -goroot /opt/homebrew/Cellar/go@1.24/1.24.11/libexec -dirs fixedbugs -case '^(fixedbugs/(bug347|bug348|issue14646|issue27201|issue29504|issue33724|issue4562|issue5856)\\.go)$' -run-timeout 2m -build-timeout 5m
  • go test ./ssa -count=1 -timeout=15m
  • go test ./cl -count=1 -timeout=15m
  • (cd runtime && go test ./... -count=1 -timeout=15m)
  • git diff --check

@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 59.63855% with 67 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cl/instr.go 55.00% 39 Missing and 6 partials ⚠️
cl/compile.go 68.75% 16 Missing and 4 partials ⚠️
ssa/package.go 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants